package com.da.javatest.leetCode;

/**
 * @author chenlida
 * @date 2018/12/20 19:54
 * @description
 */
public class Code700 {
    private TreeNode r;

    public TreeNode searchBST(TreeNode root, int val) {
        if (root == null) { return null; }
        if (val == root.val) {
            r = root;
        }
        searchBST(root.left, val);
        searchBST(root.right, val);
        return r;
    }
}
